﻿/*
 * ChatFrame.java
 *
 * Created on __DATE__, __TIME__
 */

package client.frame;

import java.awt.Color;
import java.awt.Font;

import javax.swing.UIManager;

import client.common.MyLabel;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

/**
 *
 * @author  __USER__
 */
public class ChatFrame extends javax.swing.JFrame
{

	/** Creates new form ChatFrame */
	public ChatFrame()
	{
		initComponents();
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	//GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents()
	{

		jPanel右侧面板 = new javax.swing.JPanel();
		jLabelQQ秀_对方 = new javax.swing.JLabel();
		jLabelQQ秀_自己 = new javax.swing.JLabel();
		jPanel左侧面板 = new javax.swing.JPanel();
		jLabel视频 = new javax.swing.JLabel();
		jLabel语音 = new javax.swing.JLabel();
		jLabel发送文件 = new javax.swing.JLabel();
		jPanel聊天面板 = new javax.swing.JPanel();
		jScrollPane1 = new javax.swing.JScrollPane();
		jTextPane接收框 = new javax.swing.JTextPane();
		jPanel发送面板 = new javax.swing.JPanel();
		jButton发送 = new javax.swing.JButton();
		jButton关闭 = new javax.swing.JButton();
		javax.swing.JPanel jPanel工具面板 = new javax.swing.JPanel();
		jLabel字体 = new javax.swing.JLabel();
		jLabel表情 = new javax.swing.JLabel();
		jLabel表情.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e)
			{
				selectFace();
			}
		});
		jLabel聊天记录 = new javax.swing.JLabel();
		jScrollPane3 = new javax.swing.JScrollPane();
		jTextPane发送框 = new javax.swing.JTextPane();

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setTitle("\u804a\u5929");
		setBackground(new java.awt.Color(204, 255, 255));
		addWindowListener(new java.awt.event.WindowAdapter()
		{
			public void windowClosing(java.awt.event.WindowEvent evt)
			{
				formWindowClosing(evt);
			}
		});

		jPanel右侧面板.setBackground(new java.awt.Color(204, 255, 255));

		jLabelQQ秀_对方.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/qqshow/qqshow_girl_02_180.jpg"))); // NOI18N

		jLabelQQ秀_自己.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/qqshow/qqshow_boy_01.jpg"))); // NOI18N

		javax.swing.GroupLayout jPanel右侧面板Layout = new javax.swing.GroupLayout(
				jPanel右侧面板);
		jPanel右侧面板.setLayout(jPanel右侧面板Layout);
		jPanel右侧面板Layout.setHorizontalGroup(jPanel右侧面板Layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addComponent(jLabelQQ秀_对方).addComponent(jLabelQQ秀_自己));
		jPanel右侧面板Layout.setVerticalGroup(jPanel右侧面板Layout.createParallelGroup(
				javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel右侧面板Layout
						.createSequentialGroup()
						.addComponent(jLabelQQ秀_对方)
						.addGap(18, 18, 18)
						.addComponent(jLabelQQ秀_自己,
								javax.swing.GroupLayout.PREFERRED_SIZE, 251,
								javax.swing.GroupLayout.PREFERRED_SIZE)
						.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)));

		jPanel左侧面板.setBackground(new java.awt.Color(204, 255, 255));


		jLabel视频.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_video_54.png"))); // NOI18N
		jLabel视频.setToolTipText("\u5f00\u59cb\u89c6\u9891");

		jLabel语音.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_voice_54.png"))); // NOI18N
		jLabel语音.setToolTipText("\u5f00\u59cb\u8bed\u97f3");

		jLabel发送文件.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_sendfile_54.png"))); // NOI18N
		jLabel发送文件.setToolTipText("\u53d1\u9001\u6587\u4ef6");
		jLabel发送文件.addMouseListener(new java.awt.event.MouseAdapter()
		{
			public void mouseClicked(java.awt.event.MouseEvent evt)
			{
				jLabel发送文件MouseClicked(evt);
			}
		});



		jPanel聊天面板.setLayout(new java.awt.BorderLayout());

		jTextPane接收框.setEditable(false);
		jTextPane接收框.setEditable(false);
		jScrollPane1.setViewportView(jTextPane接收框);

		jPanel聊天面板.add(jScrollPane1, java.awt.BorderLayout.CENTER);

		jPanel发送面板.setBackground(new java.awt.Color(204, 255, 255));

		jButton发送.setText("\u53d1\u9001");
		jButton发送.setFont(new Font("Microsoft YaHei UI",Font.BOLD,16));
		jButton发送.addActionListener(new java.awt.event.ActionListener()
		{
			public void actionPerformed(java.awt.event.ActionEvent evt)
			{
				jButton发送ActionPerformed(evt);
			}
		});

		jButton关闭.setText("\u5173\u95ed");
		jButton关闭.setFont(new Font("Microsoft YaHei UI",Font.BOLD,16));

		jPanel工具面板.setBackground(new java.awt.Color(204, 255, 255));

		jLabel字体.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_font_32.png"))); // NOI18N
		jLabel字体.setToolTipText("\u5b57\u4f53");
		jLabel字体.setBorder(javax.swing.BorderFactory.createEtchedBorder(
				new java.awt.Color(204, 255, 255), new java.awt.Color(204, 255,
						255)));

		jLabel表情.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_face_32.png"))); // NOI18N
		jLabel表情.setToolTipText("\u8868\u60c5");



		jLabel聊天记录.setIcon(new javax.swing.ImageIcon(getClass().getResource(
				"/client/img/chat/fun_message_history_32.png"))); // NOI18N
		jLabel聊天记录.setText("\u804a\u5929\u8bb0\u5f55");
		jLabel聊天记录
				.setToolTipText("\u6253\u5f00\u6211\u7684\u804a\u5929\u8bb0\u5f55");

		javax.swing.GroupLayout jPanel工具面板Layout = new javax.swing.GroupLayout(
				jPanel工具面板);
		jPanel工具面板.setLayout(jPanel工具面板Layout);
		jPanel工具面板Layout
				.setHorizontalGroup(jPanel工具面板Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel工具面板Layout
										.createSequentialGroup()
										.addContainerGap()
										.addComponent(
												jLabel字体,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												36,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jLabel表情)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jLabel语音)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(jLabel视频)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
										.addComponent(jLabel发送文件)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED,
												193, Short.MAX_VALUE)
										.addComponent(jLabel聊天记录)));
		jPanel工具面板Layout
				.setVerticalGroup(jPanel工具面板Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel工具面板Layout
										.createSequentialGroup()
										.addGroup(
												jPanel工具面板Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(jLabel字体)
														.addComponent(jLabel表情)
														.addComponent(jLabel语音)
														.addComponent(jLabel视频)
														.addComponent(jLabel发送文件)
														.addComponent(
																jLabel聊天记录))
										.addContainerGap()));

		jScrollPane3.setViewportView(jTextPane发送框);

		javax.swing.GroupLayout jPanel发送面板Layout = new javax.swing.GroupLayout(
				jPanel发送面板);
		jPanel发送面板.setLayout(jPanel发送面板Layout);
		jPanel发送面板Layout
				.setHorizontalGroup(jPanel发送面板Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addComponent(jPanel工具面板,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								javax.swing.GroupLayout.DEFAULT_SIZE,
								Short.MAX_VALUE)
						.addGroup(
								javax.swing.GroupLayout.Alignment.TRAILING,
								jPanel发送面板Layout
										.createSequentialGroup()
										.addContainerGap(321, Short.MAX_VALUE)
										.addComponent(
												jButton关闭,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												76,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jButton发送,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												77,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(5, 5, 5))
						.addComponent(jScrollPane3,
								javax.swing.GroupLayout.DEFAULT_SIZE, 486,
								Short.MAX_VALUE));
		jPanel发送面板Layout
				.setVerticalGroup(jPanel发送面板Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								javax.swing.GroupLayout.Alignment.TRAILING,
								jPanel发送面板Layout
										.createSequentialGroup()
										.addComponent(
												jPanel工具面板,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												36,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jScrollPane3,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												130,
												javax.swing.GroupLayout.PREFERRED_SIZE)
										.addGap(10, 10, 10)
										.addGroup(
												jPanel发送面板Layout
														.createParallelGroup(
																javax.swing.GroupLayout.Alignment.LEADING)
														.addComponent(
																jButton发送,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																38,
																Short.MAX_VALUE)
														.addComponent(
																jButton关闭,
																javax.swing.GroupLayout.DEFAULT_SIZE,
																38,
																Short.MAX_VALUE))
										.addContainerGap()));

		javax.swing.GroupLayout jPanel左侧面板Layout = new javax.swing.GroupLayout(
				jPanel左侧面板);
		jPanel左侧面板.setLayout(jPanel左侧面板Layout);
		jPanel左侧面板Layout.setHorizontalGroup(jPanel左侧面板Layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addComponent(jPanel发送面板, javax.swing.GroupLayout.DEFAULT_SIZE,
						javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addComponent(jPanel聊天面板, javax.swing.GroupLayout.DEFAULT_SIZE,
						486, Short.MAX_VALUE));
		jPanel左侧面板Layout
				.setVerticalGroup(jPanel左侧面板Layout
						.createParallelGroup(
								javax.swing.GroupLayout.Alignment.LEADING)
						.addGroup(
								jPanel左侧面板Layout
										.createSequentialGroup()
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jPanel聊天面板,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												260, Short.MAX_VALUE)
										.addPreferredGap(
												javax.swing.LayoutStyle.ComponentPlacement.RELATED)
										.addComponent(
												jPanel发送面板,
												javax.swing.GroupLayout.PREFERRED_SIZE,
												javax.swing.GroupLayout.DEFAULT_SIZE,
												javax.swing.GroupLayout.PREFERRED_SIZE)));

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						javax.swing.GroupLayout.Alignment.TRAILING,
						layout.createSequentialGroup()
								.addComponent(jPanel左侧面板,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addComponent(jPanel右侧面板,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										javax.swing.GroupLayout.DEFAULT_SIZE,
										javax.swing.GroupLayout.PREFERRED_SIZE)));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addComponent(jPanel右侧面板, javax.swing.GroupLayout.DEFAULT_SIZE,
						javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
				.addComponent(jPanel左侧面板,
						javax.swing.GroupLayout.Alignment.TRAILING,
						javax.swing.GroupLayout.DEFAULT_SIZE,
						javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));

		pack();
	}// </editor-fold>
	//GEN-END:initComponents

	private void formWindowClosing(java.awt.event.WindowEvent evt)
	{
		// TODO add your handling code here:
		beforeClose();
	}

	private void jLabel发送文件MouseClicked(java.awt.event.MouseEvent evt)
	{
		// TODO add your handling code here:
		sendFile();
	}

	private void jButton发送ActionPerformed(java.awt.event.ActionEvent evt)
	{
		// TODO add your handling code here:
		sendMessage();
	}

	//GEN-BEGIN:variables
	// Variables declaration - do not modify
	private javax.swing.JButton jButton关闭;
	public javax.swing.JButton jButton发送;
	private javax.swing.JLabel jLabelQQ秀_对方;
	private javax.swing.JLabel jLabelQQ秀_自己;
	public javax.swing.JLabel jLabel发送文件;
	public javax.swing.JLabel jLabel视频;
	public javax.swing.JLabel jLabel语音;
	public javax.swing.JLabel jLabel字体;
	public javax.swing.JLabel jLabel聊天记录;
	public javax.swing.JLabel jLabel表情;

	private javax.swing.JPanel jPanel发送面板;
	private javax.swing.JPanel jPanel右侧面板;
	private javax.swing.JPanel jPanel左侧面板;
	private javax.swing.JPanel jPanel聊天面板;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JScrollPane jScrollPane3;
	public javax.swing.JTextPane jTextPane发送框;
	public javax.swing.JTextPane jTextPane接收框;

	// End of variables declaration//GEN-END:variables

	public javax.swing.JTextPane getjTextPane聊天记录()
	{
		return jTextPane接收框;
	}

	public void setjTextPane聊天记录(javax.swing.JTextPane jTextPane聊天记录)
	{
		this.jTextPane接收框 = jTextPane聊天记录;
	}

	/**
	 * 发送消息，空的方法，由子类实现
	 */
	public void sendMessage()
	{
	}

	public void beforeClose(){}
	/**
	 * 选择表情
	 */
	public void selectFace(){}
	/**
	 * 处理消息中的表情
	 */
	public void dealIcon(String str)
	{
		
	}
	/**
	 * 发送文件
	 */
	public void sendFile()
	{
		
	}

	
	/**
	 * 发送图片
	 */
	public void sendImg()
	{
		
	}


	
	public void screenFram()
	{
		
	}

}